package cn.ljy.uem.web.action.backstage.project;

import cn.ljy.authority.web.controller.backstage.BaseBackstageController;
import cn.ljy.common.model.result.ResponseData;
import cn.ljy.uem.model.ProjectRole;
import cn.ljy.uem.model.query.ProjectRoleQuery;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;
import javax.validation.constraints.NotEmpty;


/**
 * @description 工程角色的业务层接口
 * @author 廖振豪
 * @date 2023-1-17
 */
@Api(tags = "后台的工程角色模块")
@RestController
@RequestMapping(value = "/api/backstage/school/projectrole")
public class ProjectRoleController extends BaseBackstageController<ProjectRole, ProjectRoleQuery,Integer> {

    @ApiOperation(value = "查询所有工程角色")
    @GetMapping("/all")
    @Override
    protected ResponseData query(ProjectRoleQuery query) {
        return super.query(query);
    }

    @ApiOperation(value = "分页查询工程角色")
    @Override
    public ResponseData query(Integer page, Integer pageSize, ProjectRoleQuery query){
        return super.query(page,pageSize,query);
    }

    @ApiOperation(value = "读取工程角色")
    @Override
    protected ResponseData get(@PathVariable("id") Integer id) {
        return super.get(id);
    }

    @ApiOperation(value = "批量删除指定的多个工程角色")
    @Override
    protected ResponseData deletes(@NotEmpty(message = "操作失败：请选择要移除的记录") Integer[] ids) {
        return super.deletes(ids);
    }


    @ApiOperation(value = "添加工程角色")
    @Override
    protected ResponseData add(@Valid @RequestBody ProjectRole projectRole) {
        return super.add(projectRole);
    }

    @ApiOperation(value = "编辑工程角色")
    @Override
    protected ResponseData edit(@Valid @RequestBody ProjectRole projectRole) {
        return super.edit(projectRole);
    }
}
